<?php
    $this->load->view('wx/public/header.html', [
        'time' => time(),
       'css' => [
            'assets/wx/css/order.css',
        ]
    ]);
?>

<body class="order" ng-controller="wx-order-detail-controller">

<div class="aui-content aui-margin-b-10">
    <ul class="aui-list aui-media-list">
        <li class="aui-list-item" style="padding-left: 30px;">
            <div class="aui-media-list-item-inner">
                <div class="aui-list-item-inner">
                    <i class="aui-iconfont aui-icon-location gu-location-detail-icon"></i>
                    <div class="aui-list-item-title">
                        <strong class="aui-font-size-14" ng-bind="order.address.name"></strong>
                        <span class="aui-pull-right aui-font-size-12" ng-bind="order.address.phone"></span>
                    </div>
                    <div class="aui-list-item-text aui-font-size-12" ng-bind="order.address.address"></div>
                </div>
            </div>
        </li>
        <li class="aui-list-item aui-list-item-arrow">
            <div class="aui-media-list-item-inner">
                <div class="aui-list-item-inner">
                    <div class="aui-list-item-text" ng-click="viewExp()">
                        <div class="aui-list-item-title aui-font-size-14">查看物流信息</div>
                        <div class="aui-list-item-right" ng-bind="!order.distribution.expressNo ? '暂无' : order.distribution.expressName"></div>
                    </div>
                </div>
            </div>
        </li>
    </ul>
</div>

<!--商品-->

<section class="aui-content aui-margin-b-10">
    <div class="aui-card-list gu-order-card-list-item">
        <div class="aui-card-list-header gu-order-sn aui-padded-r-10">
            <span class="aui-pull-left aui-font-size-14">订单详情</span>
        </div>
        <div class="aui-card-list-content">
            <ul class="aui-list aui-media-list">
                <li class="aui-list-item gu-lists" ng-repeat="g in order.goods">
                    <div class="aui-media-list-item-inner">
                        <div class="aui-list-item-media gu-confirm-thumb">
                            <img ng-src="{{ g.thumb }}">
                        </div>

                        <div class="aui-list-item-inner">
                            <div class="aui-list-item-text aui-margin-b-15">
                                <div class="aui-list-item-title aui-ellipsis-2 gu-order-goods-name aui-font-size-12" ng-bind="g.goodsName"></div>
                                <div class="aui-list-item-right gu-order-price aui-font-size-16" ng-bind="'￥ ' + g.price_format"></div>
                            </div>
                            <div class="aui-info aui-margin-t-10 aui-margin-l-0 aui-margin-r-0 gu-info-item" style="padding:0">
                                <div class="aui-info-item" ng-bind="'规格: ' + g.ruleName"></div>
                                <div class="aui-info-item" ng-bind="'数量: ' + g.num"></div>
                            </div>
                        </div>
                    </div>
                </li>
            </ul>
        </div>
    </div>
</section>

<section class="aui-content aui-margin-b-10">
    <div class="aui-card-list aui-margin-b-0">
        <div class="aui-card-list-header aui-font-size-14">买家留言</div>
        <div class="aui-card-list-content-padded aui-font-size-12 aui-border-t" style="color: #757575;" ng-bind="!order.message ? '无' : order.message">
        </div>
    </div>
</section>

<!--价格-->
<div class="aui-content aui-margin-b-10">
    <ul class="aui-list aui-list-in">
        <li class="aui-list-item">
            <div class="aui-list-item-inner">
                <div class="aui-list-item-title aui-font-size-14">商品价格</div>
                <div class="aui-list-item-right aui-font-size-14" ng-bind="'￥ ' + order.goodsPrice"></div>
            </div>
        </li>
        <li class="aui-list-item">
            <div class="aui-list-item-inner">
                <div class="aui-list-item-title aui-font-size-14">物流费用</div>
                <div class="aui-list-item-right aui-font-size-14" ng-bind="'￥ ' + order.expressPrice"></div>
            </div>
        </li>
        <li class="aui-list-item">
            <div class="aui-list-item-inner">
                <div class="aui-list-item-title aui-font-size-14">优惠券</div>
                <div class="aui-list-item-right aui-font-size-14" ng-bind="'- ￥ ' + order.voucherPrice"></div>
            </div>
        </li>
        <li class="aui-list-item">
            <div class="aui-list-item-inner">
                <div class="aui-list-item-title aui-font-size-14">余额支付</div>
                <div class="aui-list-item-right aui-font-size-14" ng-bind="'- ￥ ' + order.balancePrice"></div>
            </div>
        </li>
        <li class="aui-list-item">
            <div class="aui-list-item-inner">
                <div class="aui-list-item-title aui-font-size-14">实付金额</div>
                <div class="aui-list-item-right aui-font-size-14 gu-price-desc" ng-bind="'￥ ' + order.totalPrice"></div>
            </div>
        </li>
    </ul>
</div>

<!--订单状态-->
<div class="aui-content aui-margin-b-10">
    <ul class="aui-list aui-list-in">
        <li class="aui-list-item">
            <div class="aui-list-item-inner">
                <div class="aui-list-item-title aui-font-size-14">订单状态</div>
                <div class="aui-list-item-right aui-font-size-14 aui-text-danger" ng-bind="order.statusFormat"></div>
            </div>
        </li>
        <li class="aui-list-item" ng-show="order.status == 'Refund' || order.status == 'Refunded'">
            <div class="aui-list-item-inner">
                <div class="aui-list-item-title aui-font-size-14">实际退款金额</div>
                <div class="aui-list-item-right aui-font-size-14" ng-bind="order.refund.refundAmount"></div>
            </div>
        </li>
        <li class="aui-list-item" ng-show="order.status == 'Refund' || order.status == 'Refunded'">
            <div class="aui-list-item-inner">
                <div class="aui-list-item-title aui-font-size-14">备注</div>
                <div class="aui-list-item-right aui-font-size-14" ng-bind="order.refund.remark || '无'"></div>
            </div>
        </li>
    </ul>
</div>

<div class="aui-content aui-margin-b-10">
    <ul class="aui-list aui-list-in">
        <li class="aui-list-item">
            <div class="aui-list-item-inner">
                <div class="aui-list-item-title aui-font-size-14">订单编号</div>
                <div class="aui-list-item-right aui-font-size-14" ng-bind="order.sn"></div>
            </div>
        </li>
        <li class="aui-list-item">
            <div class="aui-list-item-inner">
                <div class="aui-list-item-title aui-font-size-14">下单时间</div>
                <div class="aui-list-item-right aui-font-size-14" ng-bind="order.created"></div>
            </div>
        </li>
        <li class="aui-list-item">
            <div class="aui-list-item-inner">
                <div class="aui-list-item-title aui-font-size-14">支付方式</div>
                <div class="aui-list-item-right aui-font-size-14">在线支付</div>
            </div>
        </li>
    </ul>
</div>

<!--
'Unpaid','Pending','Dispatch','Complete','Cancel','Refund','Refunded'
-->
<footer ng-if="order.status == 'Unpaid'" class="aui-bar aui-bar-tab gu-comfirm-footer" id="footer">
    <div class="aui-bar-tab-item aui-padded-l-10 aui-padded-r-10"></div>
    <div class="aui-bar-tab-item aui-padded-l-5 aui-padded-r-5">
    </div>
    <div class="aui-bar-tab-item aui-padded-l-5 aui-padded-r-5">
        <div ng-click="cancel()" class="aui-btn aui-btn-default aui-btn-block aui-btn-outlined aui-btn-sm">取消订单</div>
    </div>
    <div class="aui-bar-tab-item aui-padded-l-5 aui-padded-r-5">
        <div ng-click="payNow()" class="aui-btn aui-btn-success aui-btn-block aui-btn-outlined aui-btn-sm">立即支付</div>
    </div>
</footer>
<footer ng-if="order.status == 'Cancel'" class="aui-bar aui-bar-tab gu-comfirm-footer" id="footer">
    <div class="aui-bar-tab-item aui-padded-l-10 aui-padded-r-10"></div>
    <div class="aui-bar-tab-item aui-padded-l-5 aui-padded-r-5">
    </div>
    <div class="aui-bar-tab-item aui-padded-l-5 aui-padded-r-5">
        <div class="aui-btn aui-btn-default aui-btn-block aui-btn-outlined aui-btn-sm">删除</div>
    </div>
    <div class="aui-bar-tab-item aui-padded-l-5 aui-padded-r-5">
        <div ng-click="recover()" class="aui-btn aui-btn-success aui-btn-block aui-btn-outlined aui-btn-sm">恢复订单</div>
    </div>
</footer>
<footer ng-if="order.status == 'Pending'" class="aui-bar aui-bar-tab gu-comfirm-footer" id="footer">
    <div class="aui-bar-tab-item aui-padded-l-10 aui-padded-r-10"></div>
    <div class="aui-bar-tab-item aui-padded-l-5 aui-padded-r-5">
    </div>
    <div class="aui-bar-tab-item aui-padded-l-5 aui-padded-r-5">
    </div>
    <div class="aui-bar-tab-item aui-padded-l-5 aui-padded-r-5">
        <div class="aui-btn aui-btn-danger aui-btn-block aui-btn-outlined aui-btn-sm">再次购买</div>
    </div>
</footer>
<footer ng-if="order.status == 'Dispatch'" class="aui-bar aui-bar-tab gu-comfirm-footer" id="footer">
    <div class="aui-bar-tab-item aui-padded-l-10 aui-padded-r-10"></div>
    <div class="aui-bar-tab-item aui-padded-l-5 aui-padded-r-5">
    </div>
    <div class="aui-bar-tab-item aui-padded-l-5 aui-padded-r-5">
    </div>
    <div class="aui-bar-tab-item aui-padded-l-5 aui-padded-r-5">
        <div class="aui-btn aui-btn-danger aui-btn-block aui-btn-outlined aui-btn-sm">再次购买</div>
    </div>
</footer>
<footer ng-if="order.status == 'Complete'" class="aui-bar aui-bar-tab gu-comfirm-footer" id="footer">
    <div class="aui-bar-tab-item aui-padded-l-10 aui-padded-r-10"></div>
    <div class="aui-bar-tab-item aui-padded-l-5 aui-padded-r-5">
        <div class="aui-btn aui-btn-default aui-btn-block aui-btn-outlined aui-btn-sm">退货</div>
    </div>
    <div class="aui-bar-tab-item aui-padded-l-5 aui-padded-r-5">
        <div class="aui-btn aui-btn-danger aui-btn-block aui-btn-outlined aui-btn-sm">再次购买</div>
    </div>
    <div class="aui-bar-tab-item aui-padded-l-5 aui-padded-r-5">
        <div class="aui-btn aui-btn-success aui-btn-block aui-btn-outlined aui-btn-sm">确认收货</div>
    </div>
</footer>
<footer ng-if="order.status == 'Refund' || order.status=='Refuned'" class="aui-bar aui-bar-tab gu-comfirm-footer" id="footer">
    <div class="aui-bar-tab-item aui-padded-l-10 aui-padded-r-10"></div>
    <div class="aui-bar-tab-item aui-padded-l-5 aui-padded-r-5">
    </div>
    <div class="aui-bar-tab-item aui-padded-l-5 aui-padded-r-5">
    </div>
    <div class="aui-bar-tab-item aui-padded-l-5 aui-padded-r-5">
        <div class="aui-btn aui-btn-danger aui-btn-block aui-btn-outlined aui-btn-sm">再次购买</div>
    </div>
</footer>


<?php
    $this->load->view('wx/public/footer.html', [
        'time' => time(),
        'js' => [
            'assets/wx/js/order/detail.js'
        ]
    ]);
?>
